約 4,766,974 件
https://w.atwiki.jp/tamotech/
Wikiリニューアル計画 まじめに個人用のナレッジベースとしたい 仕事で得た知識・必要となる知識、個人的に勉強したもの、なんでも ただのコピペ、記録にしない メモページ wikiっときたいことがら 基礎知識(Java) SJC-PベースのJavaAPIについて(自分がよくわかってないとこだけでよい) SJC-WCベースのサーブレット周り OSSフレームワーク Eclipse その他 Linux コマンドリファレンス集 LPICベースのナレッジ サーバー構築作業メモ Web その他 ネットワークの勉強をしとこう TCP/IPアレルギー撲滅ドリル(@IT) 独学で目指すネットワーク入門 TCP/IPの説明ではIPアドレスの構成とかがわかりやすく書かれてるよ。 基礎を押さえておきたい JavaScript →からのAjax HTTPプロトコル SOAP Androidアプリケーション開発 データベース、DBMS Oracle(OracleMasterベース) MySQL 排他制御 デザインパターン おしごと クラウド技術(市場に出ているクラウドサービスに何があるか、どんな技術で実現されているか) お役立ちサイト -TECHSOCRE- IT技術記事を読む 読んだ連載記事 ↓古いよ↓ tamotech@ウィキとは たもつの個人ウィキである IT技術に関するまとめ・備忘録をメインテーマとする 資格取得対策に特化した内容もある まったく関連の無いことのメモ代わりにもなったりする タモテックノート トラブルシュート集 tomcat起動コマンド # /sbin/service tomcat5 start Starting tomcat5 [ OK ] # mysql → CentOS5.5 mysql-5.0.77-4.el5_5.4ってのは最初から入ってるっぽい。。CentOSインストール時に入れたのかな。 # rpm -qa mysql* mysql-5.0.77-4.el5_5.4 しかしサーバ起動コマンド(mysqld)が見つからない。mysql-serverをyumでインストール。 # yum -y install mysql-server Loaded plugins fastestmirror Loading mirror speeds from cached hostfile * addons www.ftp.ne.jp * base www.ftp.ne.jp * extras www.ftp.ne.jp * updates www.ftp.ne.jp addons | 951 B 00 00 base | 2.1 kB 00 00 dag | 1.1 kB 00 00 extras | 2.1 kB 00 00 updates | 1.9 kB 00 00 Setting up Install Process Resolving Dependencies -- Running transaction check --- Package mysql-server.i386 0 5.0.77-4.el5_5.4 set to be updated -- Processing Dependency perl-DBD-MySQL for package mysql-server -- Running transaction check --- Package perl-DBD-MySQL.i386 0 3.0007-2.el5 set to be updated -- Finished Dependency Resolution Dependencies Resolved ======================================================================================================= Package Arch Version Repository Size ======================================================================================================= Installing mysql-server i386 5.0.77-4.el5_5.4 updates 9.8 M Installing for dependencies perl-DBD-MySQL i386 3.0007-2.el5 base 148 k Transaction Summary ======================================================================================================= Install 2 Package(s) Upgrade 0 Package(s) Total download size 9.9 M Downloading Packages (1/2) perl-DBD-MySQL-3.0007-2.el5.i386.rpm | 148 kB 00 00 (2/2) mysql-server-5.0.77-4.el5_5.4.i386.rpm | 9.8 MB 00 08 ------------------------------------------------------------------------------------------------------- Total 1.1 MB/s | 9.9 MB 00 09 Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing perl-DBD-MySQL 1/2 Installing mysql-server 2/2 Installed mysql-server.i386 0 5.0.77-4.el5_5.4 Dependency Installed perl-DBD-MySQL.i386 0 3.0007-2.el5 Complete! mysqldで起動成功 # /etc/init.d/mysqld start MySQL データベースを初期化中 Installing MySQL system tables... 110206 21 34 28 [Warning] option max_join_size unsigned value 18446744073709551615 adjusted to 4294967295 110206 21 34 28 [Warning] option max_join_size unsigned value 18446744073709551615 adjusted to 4294967295 OK Filling help tables... 110206 21 34 28 [Warning] option max_join_size unsigned value 18446744073709551615 adjusted to 4294967295 110206 21 34 28 [Warning] option max_join_size unsigned value 18446744073709551615 adjusted to 4294967295 OK To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands /usr/bin/mysqladmin -u root password new-password /usr/bin/mysqladmin -u root -h localhost.localdomain password new-password Alternatively you can run /usr/bin/mysql_secure_installation which will also give you the option of removing the test databases and anonymous user created by default. This is strongly recommended for production servers. See the manual for more instructions. You can start the MySQL daemon with cd /usr ; /usr/bin/mysqld_safe You can test the MySQL daemon with mysql-test-run.pl cd mysql-test ; perl mysql-test-run.pl Please report any problems with the /usr/bin/mysqlbug script! The latest information about MySQL is available on the web at http //www.mysql.com Support MySQL by buying support/licenses at http //shop.mysql.com [ OK ] MySQL を起動中 [ OK ] # 資格取得対策 LPIC レベル1 メモ帳 狙い目デジカメ比較
https://w.atwiki.jp/m_shige1979/pages/711.html
初期設定 ダウンロード MySQLのサイトよりソースコードのファイルをダウンロードを行う インストール MySQLインストール cd /usr/local/src tar xzf mysql-5.1.51.tar.gz cd mysql-5.1.51 ./configure \ --with-charset=utf8 \ --with-extra-charsets=all \ --with-mysqld-user=mysql \ --with-innodb \ --enable-local-infile \ --prefix=/usr/local/mysql \ --with-tcp-port=3306 \ --with-unix-socket-path=/tmp/mysql.sock make make install 環境設定 ## ユーザー登録 groupadd mysql useradd -g mysql -d /home/mysql -m mysql passwd mysql ## 所有者権限変更 chown mysql mysql -R /usr/local/mysql ## データベース初期化 ./scripts/mysql_install_db --user=mysql ## 所有者権限変更 chown -R mysql /usr/local/mysql/ chgrp -R mysql /usr/local/mysql/ ## ポート開放 /sbin/iptables -I INPUT -p tcp -m tcp --dport 3306 --syn -j ACCEPT パスを設定 vi /etc/profile #################################### export PATH=$PATH /usr/local/mysql/bin #################################### source /etc/profile デーモン登録 ## http //www.openssl.org/source/ cp support-files/mysql.server /etc/rc.d/init.d/mysql cp support-files/my-huge.cnf.sh /usr/local/mysql/my.cnf chmod 755 /etc/rc.d/init.d/mysql chkconfig --add mysql /etc/init.d/mysql start リモート接続 su - mysql ## rootパスワードの設定 mysql -u root grant select,insert,delete,update,create,drop,file,alter,index on *.* to db_user@"%" identified by password ; flush privileges; quit
https://w.atwiki.jp/mheroes/pages/42.html
公式:http //heroes.nexon.co.jp/notice/all.aspx?no=147 ウィンターイベント → 2011ウィンターイベント クローダのメリークリスマス! 期間:2011年12月21日 〜 2012月1月5日 メンテナンス前 → 2011年12月21日 〜 2012月12月27日 メンテナンス前 ツリーを飾ろう 期間:2011年12月21日 〜 2012月1月5日 メンテナンス前 プレゼントを死守せよ! 期間:2011年12月21日 〜 2012月1月5日 メンテナンス前 クリスマスに雪が降れば・・・ 期間:2011年12月21日 〜 2012月1月5日 メンテナンス前 ポイントアイテム追加 → アイテムショップ エンチャントのルーン 帰属解除ポーション クリスマスチケット ニューイヤーパッケージ 通常販売開始 ボディペインティング「タイガートルソー」と「タイガーテール」 ポイントアイテム販売終了 ※2012年1月12日(木)に、以下のアイテムの販売を終了いたします。 傭兵パッケージ 戦闘パッケージ ビューティーショップ追加 → リシタ/容姿 フィオナ/容姿 イヴィ/容姿 新規ヘア(各キャラクター4種、30日/90日) 新規インナーアーマー(各キャラクター2種、30日/90日/無期限) 新規ボディーペインティング(タイガートルソー、タイガーテール) ネットカフェスタートダッシュ特典イベント終了 ボディーペインティング購入イベント報酬配布延期 不具合の修正 (確認できたものがあれば投稿してください) イヴィのスキル「錬金術:マナピストル」が使用できない問題を修正 その他追加・変更点 (確認できたものがあれば投稿してください) 新たに確認された不具合 (まずは検証・確認を要する投稿へ。いきなりここに書かないで下さい) 検証・確認を要する投稿 (不具合か変更か不明な現象・確率が関わる現象・検証が不十分と思われる投稿はこちらへ) 編集報告用 (コメント整理等で必要な報告があればこちらへ)
https://w.atwiki.jp/gtavi_gta6/pages/2274.html
タイトルアップデート (1.20) 1.20 2014年12月23日 「GTAオンライン」の安定性の向上。
https://w.atwiki.jp/my-sql/pages/98.html
HOME 関数 日付と時刻関数 DATEDIFF DATEDIFF DATEDIFF(expr,expr2) DATEDIFF() は開始日 expr と終了日 expr2 との間の日数を返す。 expr と expr2 には、日付式か、日付時刻式を指定する。 計算は値の日付部分のみに基づいて行われる。 mysql SELECT DATEDIFF( 1997-12-31 23 59 59 , 1997-12-30 ); - 1 mysql SELECT DATEDIFF( 1997-11-31 23 59 59 , 1997-12-31 ); - -30 DATEDIFF() は MySQL 4.1.1 で追加された。
https://w.atwiki.jp/okzmemorandum/pages/26.html
以下のようにIF ENDの間にSQLコメントとして埋め込む。 /*IF inputCode != null*/ CODE = /*inputCode*/ -- ELSE CODE IS NULL /*END*/
https://w.atwiki.jp/gtav/pages/2274.html
タイトルアップデート (1.20) 1.20 2014年12月23日 「GTAオンライン」の安定性の向上。
https://w.atwiki.jp/gtav/pages/2275.html
タイトルアップデート (1.18) 1.18 2014年11月18日 「GTAオンライン」におけるプレイヤーの乗り物データの問題を修正
https://w.atwiki.jp/naobe/pages/68.html
OpenSourceに戻る Spring概要 DIxAOPコンテナ DIを使い、疎な結合でクラスを注入する。DIを使っているため注入される上位層クラスのソースを修正しないで、下位層のクラスを取替え可能。よって下位層を改造しても上位層をテストする必要がない(変更に強い)。 Singletonを使わないで、単一インスタンスを提供する(デフォルト機能)。 宣言的なトランザクション機能を持ち、AOPを使ってトランザクションをビジネスロジックと切り離して実装できる。 AOP(Aspect-Oriented Programming)。ソースを変更しないで、横断的(【例】あるパターンを持ったメソッド全て)に機能(ログ、トランザクション、例外処理、キャッシュなど)を追加する。 使用したバージョン フレームワーク バージョン spring 3.0.1 ibatis 2.3.4 Bean定義ファイル Bean定義の大本となるファイル。services.xmlはクラスパス。後の2つのファイルは、このファイルのディレクトリからの相対パス。 beans import resource="services.xml"/ import resource="resources/messageSource.xml"/ import resource="/resources/themeSource.xml"/ bean id="bean1" class="..."/ bean id="bean2" class="..."/ /beans クラスパスを使う場合は、"classpath /resources/themeSource.xml"と記述する。絶対パスを使う場合は、"file C /config/aaa.xml"と記述する。 Log4j web.xmlに以下を追加。 context-param param-name log4jConfigLocation /param-name param-value /WEB-INF/classes/resource/log4j.xml /param-value /context-param listener listener-class org.springframework.web.util.Log4jConfigListener /listener-class /listener iBatis2.Xとの結合 ビーン定義ファイル 配置 WEB-INF/app-bean-context.xml 記述 ?xml version="1.0" encoding="UTF-8"? beans xmlns="http //www.springframework.org/schema/beans" xmlns xsi="http //www.w3.org/2001/XMLSchema-instance" xmlns context="http //www.springframework.org/schema/context" xsi schemaLocation="http //www.springframework.org/schema/beans http //www.springframework.org/schema/beans/spring-beans-3.0.xsd http //www.springframework.org/schema/context http //www.springframework.org/schema/context/spring-context-3.0.xsd " !-- プレースホルダプロパティファイル設定 -- context property-placeholder location="classpath resource/ibatis/config.properties"/ bean id="dataSource" class="org.apache.tomcat.dbcp.dbcp.BasicDataSource" destroy-method="close" property name="driverClassName" value="${jdbc.driverClassName}" / property name="url" value="${jdbc.url}" / property name="username" value="${user}" / property name="password" value="${passwd}" / /bean bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean" property name="configLocation" value="WEB-INF/classes/resource/ibatis/kakeiboMapConfig.xml" / property name="dataSource" ref="dataSource" / /bean bean id="kakeiboDao" class="suna.screen.kakeibo.dao.KakeiboDaoImpl" property name="sqlMapClient" ref="sqlMapClient"/ /bean /beans プロパティファイル パス WEB-INF/classes/resource/config.properties 記述 user = user passwd = passwd jdbc.driverClassName = com.ibm.db2.jcc.DB2Driver jdbc.url = jdbc db2 //localhost 50000/suna DAOクラス public class KakeiboDaoImpl extends SqlMapClientDaoSupport implements KakeiboDao { public List Incident selectIncident() { return getSqlMapClientTemplate().queryForList(SELECT_INCIDENT); } } SQLマップ設定ファイル パス WEB-INF/classes/resource/ibatis/kakeiboMapConfig.xml ビーン定義ファイル参照 記述 ?xml version="1.0" encoding="UTF-8" ? !DOCTYPE sqlMapConfig PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN" "http //ibatis.apache.org/dtd/sql-map-config-2.dtd" sqlMapConfig sqlMap resource="resource/ibatis/mapper/incidentMapper.xml" / sqlMap resource="resource/ibatis/mapper/shusiNameMapper.xml" / /sqlMapConfig SQLマップファイル パス resource/ibatis/mapper/incidentMapper.xml クラスパス。 記述 ?xml version="1.0" encoding="UTF-8" ? !DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http //ibatis.apache.org/dtd/sql-map-2.dtd" sqlMap typeAlias alias="Incident" type="suna.screen.kakeibo.dao.Incident" / resultMap id="incidentResult" class="Incident" result property="incid" column="incid" / result property="incdate" column="incdate" / result property="shusiname" column="shusiname" / result property="nametype" column="nametype" / result property="namedetail" column="namedetail" / result property="price" column="price" / /resultMap select id="selectIncident" resultMap="incidentResult" select inc.INCID incid, inc.INCDATE incdate, name.NAME shusiname, name.NAMETYPE nametype, detail.NAMEDETAIL namedetail, inc.PRICE price from INOUTNAME name, INOUTDETAIL detail, INCIDENCE inc where inc.NAMEID = name.NAMEID AND inc.NAMEDETAILID = detail.NAMEDETAILID /select /sqlMap SpringWEBアプリケーション適用 トランザクション AOPを使ったトランザクション制御 設定ファイルを修正するだけで、トランザクションの追加が可能。設定したインタフェースの 特定のパターンのメソッド実行前後にトランザクションのビギン、コミットを実行するように設定する。 設定例は以下。interfaceのselectで始まるインタフェースを実行したときにread-onlyのトランザクションを 実行。select以外は、read-write。 AOP関係のjarがSpringにないため以下のサイトからaspectj-1.6.11.jarをダウンロード。 解凍してlibディレクトリ以下のjarファイルをインポート。 http //www.eclipse.org/aspectj/downloads.php 【インタフェース】 package suna.screen.kakeibo.dao; public interface KakeiboDao { List Incident selectDayIncident(Calendar day, int type); List Map String, Object selectInout(); List Map String, Object selectInout(int type); List Map String, Object selectDetail(); void insertIncident(int year, int month, int day, String nameId, String detailId, int price); void deleteIncident(String[] incidentId); void insertInoutName(String name, String shusi); void insertInoutDetail(String detail); void deleteInoutName(String komoku); void deleteInoutDetail(String komoku); List IncidentSummary selectMonthSummary(int year, int month, int kubun); } 【ビーンコンテキスト設定ファイル】 ?xml version="1.0" encoding="UTF-8"? beans xmlns="http //www.springframework.org/schema/beans" xmlns xsi="http //www.w3.org/2001/XMLSchema-instance" xmlns context="http //www.springframework.org/schema/context" xmlns aop="http //www.springframework.org/schema/aop" xmlns tx="http //www.springframework.org/schema/tx" xsi schemaLocation="http //www.springframework.org/schema/beans http //www.springframework.org/schema/beans/spring-beans-3.0.xsd http //www.springframework.org/schema/context http //www.springframework.org/schema/context/spring-context-3.0.xsd http //www.springframework.org/schema/tx http //www.springframework.org/schema/tx/spring-tx-3.0.xsd http //www.springframework.org/schema/aop http //www.springframework.org/schema/aop/spring-aop-3.0.xsd" !-- プレースホルダプロパティファイル設定 -- context property-placeholder location="classpath resource/ibatis/config.properties"/ !-- トランザクションAOPアドバイス -- tx advice id="txAdvice" transaction-manager="txManager" !-- the transactional semantics... -- tx attributes !-- selectで始まるメソッド -- tx method name="select*" read-only="true" propagation="REQUIRED"/ !-- select以外デフォルト設定(read-only false つまり、read-write) -- tx method name="*" propagation="REQUIRED"/ /tx attributes /tx advice !-- AOPポイントカット -- aop config !-- KakeiboDaoインタフェースの全てのメソッドに対してtxAdviceを適用 -- aop pointcut id="kakeiboOperation" !-- expressionについては、http //www.eclipse.org/aspectj/doc/released/progguide/index.html参照 execution call, within , withincode とも書ける。 callは、再起呼び出しでも呼ばれるが、executionはNG。他にも違いはあるが詳細は不明。 第1引数:メソッドの戻り値 第2引数:クラス.メソッド(引数) 適用するメソッドをパターンで特定している。 -- expression="execution(* suna.screen.kakeibo.dao.KakeiboDao.*(..))" / aop advisor advice-ref="txAdvice" pointcut-ref="kakeiboOperation" / /aop config !-- Tomcatコネクションプール設定 -- bean id="dataSource" class="org.apache.tomcat.dbcp.dbcp.BasicDataSource" destroy-method="close" property name="driverClassName" value="${jdbc.driverClassName}" / property name="url" value="${jdbc.url}" / property name="username" value="${user}" / property name="password" value="${passwd}" / /bean bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager" property name="dataSource" ref="dataSource"/ /bean bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean" property name="configLocation" value="WEB-INF/classes/resource/ibatis/kakeiboMapConfig.xml" / property name="dataSource" ref="dataSource" / /bean bean id="kakeiboDao" class="suna.screen.kakeibo.dao.KakeiboDaoImpl" property name="sqlMapClient" ref="sqlMapClient"/ /bean /beans 【実行結果】 (1)select実行時 2011.4.26 16 41 16.078 DEBUG DefaultListableBeanFactory[http-8080-1] - Returning cached instance of singleton bean ka keiboDao 2011.4.26 16 41 16.125 DEBUG DataSourceTransactionManager[http-8080-1] - Creating new transaction with name [suna.scre en.kakeibo.dao.KakeiboDao.selectDayIncident] PROPAGATION_REQUIRED,ISOLATION_DEFAULT,readOnly 2011.4.26 16 41 22.906 DEBUG DataSourceTransactionManager[http-8080-1] - Acquired Connection [jdbc db2 //localhost 500 00/suna, UserName=suna, IBM DB2 JDBC Universal Driver Architecture] for JDBC transaction 2011.4.26 16 41 22.921 DEBUG DataSourceUtils[http-8080-1] - Setting JDBC Connection [jdbc db2 //localhost 50000/suna, UserName=suna, IBM DB2 JDBC Universal Driver Architecture] read-only 2011.4.26 16 41 23.093 DEBUG DataSourceTransactionManager[http-8080-1] - Switching JDBC Connection [jdbc db2 //localho st 50000/suna, UserName=suna, IBM DB2 JDBC Universal Driver Architecture] to manual commit 2011.4.26 16 41 23.093 DEBUG TransactionSynchronizationManager[http-8080-1] - Bound value [org.springframework.jdbc.da tasource.ConnectionHolder@a166bd] for key [org.apache.tomcat.dbcp.dbcp.BasicDataSource@119db9e] to thread [http-8080-1 ] 2011.4.26 16 41 23.093 DEBUG TransactionSynchronizationManager[http-8080-1] - Initializing transaction synchronization 2011.4.26 16 41 23.093 DEBUG TransactionInterceptor[http-8080-1] - Getting transaction for [suna.screen.kakeibo.dao.Ka keiboDao.selectDayIncident] 2011.4.26 16 41 23.093 DEBUG SqlMapClientTemplate[http-8080-1] - Opened SqlMapSession [com.ibatis.sqlmap.engine.impl.S qlMapSessionImpl@ea443f] for iBATIS operation 2011.4.26 16 41 23.109 DEBUG SqlMapClientTemplate[http-8080-1] - Obtained JDBC Connection [Transaction-aware proxy for target Connection from DataSource [org.apache.tomcat.dbcp.dbcp.BasicDataSource@119db9e]] for iBATIS operation 2011.4.26 16 41 23.109 DEBUG TransactionSynchronizationManager[http-8080-1] - Retrieved value [org.springframework.jdb c.datasource.ConnectionHolder@a166bd] for key [org.apache.tomcat.dbcp.dbcp.BasicDataSource@119db9e] bound to thread [h ttp-8080-1] 2011.4.26 16 41 23.156 DEBUG TransactionSynchronizationManager[http-8080-1] - Retrieved value [org.springframework.jdb c.datasource.ConnectionHolder@a166bd] for key [org.apache.tomcat.dbcp.dbcp.BasicDataSource@119db9e] bound to thread [h ttp-8080-1] 2011.4.26 16 41 23.468 DEBUG TransactionSynchronizationManager[http-8080-1] - Retrieved value [org.springframework.jdb c.datasource.ConnectionHolder@a166bd] for key [org.apache.tomcat.dbcp.dbcp.BasicDataSource@119db9e] bound to thread [h ttp-8080-1] 2011.4.26 16 41 23.468 DEBUG TransactionInterceptor[http-8080-1] - Completing transaction for [suna.screen.kakeibo.dao .KakeiboDao.selectDayIncident] 2011.4.26 16 41 23.468 DEBUG DataSourceTransactionManager[http-8080-1] - Triggering beforeCommit synchronization 2011.4.26 16 41 23.468 DEBUG DataSourceTransactionManager[http-8080-1] - Triggering beforeCompletion synchronization 2011.4.26 16 41 23.468 DEBUG DataSourceTransactionManager[http-8080-1] - Initiating transaction commit 2011.4.26 16 41 23.468 DEBUG DataSourceTransactionManager[http-8080-1] - Committing JDBC transaction on Connection [jd bc db2 //localhost 50000/suna, UserName=suna, IBM DB2 JDBC Universal Driver Architecture] 2011.4.26 16 41 23.468 DEBUG DataSourceTransactionManager[http-8080-1] - Triggering afterCommit synchronization 2011.4.26 16 41 23.468 DEBUG DataSourceTransactionManager[http-8080-1] - Triggering afterCompletion synchronization 2011.4.26 16 41 23.468 DEBUG TransactionSynchronizationManager[http-8080-1] - Clearing transaction synchronization 2011.4.26 16 41 23.468 DEBUG TransactionSynchronizationManager[http-8080-1] - Removed value [org.springframework.jdbc. datasource.ConnectionHolder@a166bd] for key [org.apache.tomcat.dbcp.dbcp.BasicDataSource@119db9e] from thread [http-80 80-1] 2011.4.26 16 41 23.468 DEBUG DataSourceUtils[http-8080-1] - Resetting read-only flag of JDBC Connection [jdbc db2 //lo calhost 50000/suna, UserName=suna, IBM DB2 JDBC Universal Driver Architecture] 2011.4.26 16 41 23.468 DEBUG DataSourceTransactionManager[http-8080-1] - Releasing JDBC Connection [jdbc db2 //localho st 50000/suna, UserName=suna, IBM DB2 JDBC Universal Driver Architecture] after transaction 2011.4.26 16 41 23.484 DEBUG DataSourceUtils[http-8080-1] - Returning JDBC Connection to DataSource (1)insert実行時 2011.4.26 16 46 51.875 DEBUG DataSourceTransactionManager[http-8080-1] - Creating new transaction with name [suna.scre en.kakeibo.dao.KakeiboDao.insertIncident] PROPAGATION_REQUIRED,ISOLATION_DEFAULT 2011.4.26 16 46 51.875 DEBUG DataSourceTransactionManager[http-8080-1] - Acquired Connection [jdbc db2 //localhost 500 00/suna, UserName=suna, IBM DB2 JDBC Universal Driver Architecture] for JDBC transaction 2011.4.26 16 46 51.875 DEBUG DataSourceTransactionManager[http-8080-1] - Switching JDBC Connection [jdbc db2 //localho st 50000/suna, UserName=suna, IBM DB2 JDBC Universal Driver Architecture] to manual commit 2011.4.26 16 46 51.875 DEBUG TransactionSynchronizationManager[http-8080-1] - Bound value [org.springframework.jdbc.da tasource.ConnectionHolder@a9a32c] for key [org.apache.tomcat.dbcp.dbcp.BasicDataSource@119db9e] to thread [http-8080-1 ] 2011.4.26 16 46 51.875 DEBUG TransactionSynchronizationManager[http-8080-1] - Initializing transaction synchronization 2011.4.26 16 46 51.875 DEBUG TransactionInterceptor[http-8080-1] - Getting transaction for [suna.screen.kakeibo.dao.Ka keiboDao.insertIncident] 2011.4.26 16 46 51.890 DEBUG SqlMapClientTemplate[http-8080-1] - Opened SqlMapSession [com.ibatis.sqlmap.engine.impl.S qlMapSessionImpl@114d18f] for iBATIS operation 2011.4.26 16 46 51.890 DEBUG SqlMapClientTemplate[http-8080-1] - Obtained JDBC Connection [Transaction-aware proxy for target Connection from DataSource [org.apache.tomcat.dbcp.dbcp.BasicDataSource@119db9e]] for iBATIS operation 2011.4.26 16 46 51.890 DEBUG TransactionSynchronizationManager[http-8080-1] - Retrieved value [org.springframework.jdb c.datasource.ConnectionHolder@a9a32c] for key [org.apache.tomcat.dbcp.dbcp.BasicDataSource@119db9e] bound to thread [h ttp-8080-1] 2011.4.26 16 46 51.890 DEBUG TransactionSynchronizationManager[http-8080-1] - Retrieved value [org.springframework.jdb c.datasource.ConnectionHolder@a9a32c] for key [org.apache.tomcat.dbcp.dbcp.BasicDataSource@119db9e] bound to thread [h ttp-8080-1] 2011.4.26 16 46 52.015 DEBUG TransactionSynchronizationManager[http-8080-1] - Retrieved value [org.springframework.jdb c.datasource.ConnectionHolder@a9a32c] for key [org.apache.tomcat.dbcp.dbcp.BasicDataSource@119db9e] bound to thread [h ttp-8080-1] 2011.4.26 16 46 52.015 DEBUG TransactionInterceptor[http-8080-1] - Completing transaction for [suna.screen.kakeibo.dao .KakeiboDao.insertIncident] 2011.4.26 16 46 52.015 DEBUG DataSourceTransactionManager[http-8080-1] - Triggering beforeCommit synchronization 2011.4.26 16 46 52.015 DEBUG DataSourceTransactionManager[http-8080-1] - Triggering beforeCompletion synchronization 2011.4.26 16 46 52.015 DEBUG DataSourceTransactionManager[http-8080-1] - Initiating transaction commit 2011.4.26 16 46 52.015 DEBUG DataSourceTransactionManager[http-8080-1] - Committing JDBC transaction on Connection [jd bc db2 //localhost 50000/suna, UserName=suna, IBM DB2 JDBC Universal Driver Architecture] 2011.4.26 16 46 52.015 DEBUG DataSourceTransactionManager[http-8080-1] - Triggering afterCommit synchronization 2011.4.26 16 46 52.031 DEBUG DataSourceTransactionManager[http-8080-1] - Triggering afterCompletion synchronization 2011.4.26 16 46 52.031 DEBUG TransactionSynchronizationManager[http-8080-1] - Clearing transaction synchronization 2011.4.26 16 46 52.031 DEBUG TransactionSynchronizationManager[http-8080-1] - Removed value [org.springframework.jdbc. datasource.ConnectionHolder@a9a32c] for key [org.apache.tomcat.dbcp.dbcp.BasicDataSource@119db9e] from thread [http-80 80-1] 2011.4.26 16 46 52.031 DEBUG DataSourceTransactionManager[http-8080-1] - Releasing JDBC Connection [jdbc db2 //localho st 50000/suna, UserName=suna, IBM DB2 JDBC Universal Driver Architecture] after transaction 2011.4.26 16 46 52.031 DEBUG DataSourceUtils[http-8080-1] - Returning JDBC Connection to DataSource WebSphereUowTransactionManager 内部で、UOWManagerをJNDIルックアップして使用している。たぶんWebSphereが動いていないと利用できない。
https://w.atwiki.jp/nicepaper/pages/265.html
今回はレコードの更新と削除について勉強していきます。 レコードの更新 更新というのは、レコードを変更したりすることを指しています。 UPDATEと呼ばれる操作をするため題名を変更ではなく、更新としました。 例えば、 UPDATE table_name SET name= 変更後 WHERE name= 変更前 ; というSQL文は、table_nameというテーブルのnameカラムが変更前となっている部分を変更後に変えるという意味を持ちます。 ふつうは、where句の後にはidを指定します。 なぜならば変えたい部分の他にも 変更前 という値が格納されている可能性があるためです。 UPDATE テーブル名 SET カラム名1=値1, カラム名2=値2… WHERE 条件式; 条件式で指定された行の、カラム名1に値1を格納する 、という意味です。 また、カラムは複数続けて指定する事ができます。 ※ whereを指定しないと全ての値が変更されてしまいます。変更された値をもとに戻す事は出来ないので注意が必要です。 レコードの削除 DELETE FROM table_name WHERE id=3; とすると、id=3のレコードが削除されます。 こちらももとに戻す事が出来ないので注意が必要です。 DELETE FROM テーブル名 WHERE 条件式; となります。 しかし掲示板などでphpとデータベースをリンクさせたい場合には普通deleteを使いません。 status columnというカラムを作っておいて削除ボタンで、status columnの値を変更するというやり方をとります。 statusが2で公開、言い換えればstatusが2のもののみをページに表示させ、1は下書き、0のものは非表示というような設定にします。 まとめ SQL文において基本となるのは、4つ。 insert(新しくレコード(行)を挿入) select(レコードを呼び出す) update(レコードを変更する) delete(レコードを削除する) なかでもphpでシステムを作る時は上の3つを使い分けていく。 以上